﻿<%@ Page Title="Daily Rate" Language="C#" MasterPageFile="~/Share/MainMenu.Master"
    AutoEventWireup="true" CodeBehind="fDailyExchange.aspx.cs" Inherits="MixScriptWeb.Accounting.fDailyExchange" %>

<%@ Register Src="~/control/MixScriptTB.ascx" TagName="baseTextBox" TagPrefix="mix" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            jQuery('.datepicker').datepicker({ dateFormat: 'dd-mm-yy' });
        }
    </script>
    <div style="padding-left: 10px;">
        <h2 class="jquery_tab">
            <asp:Label ID="lblTitle" runat="server" Text="Daily Exchange Rate" Font-Bold="True"></asp:Label>
            <asp:HiddenField ID="hdnShow" runat="server" Value="block" />
        </h2>
        <br />
        <table style="width: 100%;" class="table-ui">
            <tr>
                <td style="width: 20%; vertical-align: top;">
                    <asp:ListBox runat="server" ID="lbCurrency" Width="100%" AutoPostBack="true" Height="400px"
                        OnSelectedIndexChanged="lbCurrency_SelectedChange"></asp:ListBox>
                </td>
                <td style="width: 2%">
                </td>
                <td style="width: 75%">
                    <table style="width: 100%;" class="table-ui">
                        <tr>
                            <td>
                                <asp:DropDownList runat="server" ID="ddlMonth">
                                    <asp:ListItem Value="1" Text="January" />
                                    <asp:ListItem Value="2" Text="February" />
                                    <asp:ListItem Value="3" Text="March" />
                                    <asp:ListItem Value="4" Text="April" />
                                    <asp:ListItem Value="5" Text="May" />
                                    <asp:ListItem Value="6" Text="June" />
                                    <asp:ListItem Value="7" Text="July" />
                                    <asp:ListItem Value="8" Text="August" />
                                    <asp:ListItem Value="9" Text="September" />
                                    <asp:ListItem Value="10" Text="October" />
                                    <asp:ListItem Value="11" Text="November" />
                                    <asp:ListItem Value="12" Text="December" />
                                </asp:DropDownList>
                                <asp:DropDownList runat="server" ID="ddlYear">
                                    <asp:ListItem Value="2011" Text="2011" />
                                    <asp:ListItem Value="2012" Text="2012" />
                                    <asp:ListItem Value="2013" Text="2013" />
                                    <asp:ListItem Value="2014" Text="2014" />
                                    <asp:ListItem Value="2015" Text="2015" />
                                    <asp:ListItem Value="2016" Text="2016" />
                                </asp:DropDownList>
                                <asp:Button runat="server" ID="btnRefresh" CssClass="button" Text="Refresh" OnClick="btnRefresh_Click">
                                </asp:Button>
                            </td>
                            <td>
                            </td>
                            <td>
                            </td>
                        </tr>
                    </table>
                    <asp:Panel ID="pnlGrid" runat="server" Width="100%" Height="350px" ScrollBars="Auto"
                        BackColor="Control">
                        <asp:GridView runat="server" ID="gvList" CssClass="gridview" Width="100%" AutoGenerateColumns="false"
                            OnSorting="gvList_Sorting" OnRowDataBound="gvList_RowDataBound" OnRowCommand="gvList_RowCommand"
                            OnPageIndexChanging="gvList_PageIndexChanging">
                            <AlternatingRowStyle CssClass="alt" />
                            <HeaderStyle Height="40px" HorizontalAlign="Justify" />
                            <EmptyDataTemplate>
                                No data for selected currency and selected period, please add new data
                            </EmptyDataTemplate>
                            <Columns>
                                <asp:TemplateField HeaderText="Edit">
                                    <ItemTemplate>
                                        <asp:Button CommandName="Editing" Text="Update" ID="lbEdit" runat="server" CommandArgument='<%# Bind("date") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Delete">
                                    <ItemTemplate>
                                        <asp:Button CommandName="Deleting" Text="Delete" ID="lbDelete" runat="server" CommandArgument='<%# Bind("date") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="currency" HeaderText="CUR" HeaderStyle-Width="70" ItemStyle-HorizontalAlign="Center"
                                    SortExpression="currency" />
                                <asp:BoundField DataField="date" HeaderText="DATE" DataFormatString="{0:dd-MM-yyyy}"
                                    ItemStyle-HorizontalAlign="Center" SortExpression="date" />
                                <asp:TemplateField HeaderText="RATE">
                                    <ItemTemplate>
                                        <asp:TextBox runat="server" Width="80" Text='<%# Bind("rate") %>' ID="txtRate" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="SELL">
                                    <ItemTemplate>
                                        <asp:TextBox runat="server" Width="80" Text='<%# Bind("jual") %>' ID="txtSell" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="BUY">
                                    <ItemTemplate>
                                        <asp:TextBox runat="server" Width="80" Text='<%# Bind("beli") %>' ID="txtBuy" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EditRowStyle BorderColor="Silver" BorderStyle="Solid" />
                            <FooterStyle CssClass="ft" />
                            <PagerStyle BorderStyle="None" BorderWidth="0px" HorizontalAlign="Center" />
                        </asp:GridView>
                    </asp:Panel>
                    <table width="100%" class="table-ui">
                        <tr>
                            <td colspan="3">
                                <h3 class="jquery_tab">
                                    Add New
                                </h3>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table style="width: 100%;">
                                    <tr>
                                        <td>
                                            Currency
                                        </td>
                                        <td>
                                            :
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlCurency" runat="server">
                                            </asp:DropDownList>
                                        </td>
                                        <td colspan="2">
                                            <asp:CheckBox runat="server" ID="chkLess" Text="Less Than" ToolTip="Check if currency less then based currency"
                                                runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Date
                                        </td>
                                        <td>
                                            :
                                        </td>
                                        <td>
                                            <asp:TextBox ID="dateFrom" CssClass="input-small datepicker" runat="server" />
                                            : Until :
                                            <asp:TextBox ID="dateTo" runat="server" CssClass="input-small datepicker" />
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Rate
                                        </td>
                                        <td>
                                            :
                                        </td>
                                        <td colspan="3">
                                            <mix:baseTextBox ID="txtRate" runat="server" AllowNull="false" showFind="False" tooltip=""
                                                isvalid="True" isPassword="False" tWidht="100" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Sell
                                        </td>
                                        <td>
                                            :
                                        </td>
                                        <td colspan="3">
                                            <mix:baseTextBox ID="txtSell" runat="server" AllowNull="false" showFind="False" tooltip=""
                                                isvalid="True" isPassword="False" tWidht="120" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Buy
                                        </td>
                                        <td>
                                            :
                                        </td>
                                        <td colspan="3">
                                            <mix:baseTextBox ID="txtBuy" runat="server" AllowNull="false" showFind="False" tooltip=""
                                                isvalid="True" isPassword="False" tWidht="120" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                            <asp:Button runat="server" ID="btnSave" CssClass="button" Width="100" Text="Save"
                                                OnClick="btnSave_Click"></asp:Button>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
